#pragma warning(disable:4996)
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int num;
	scanf("%d", &num);
	int* p1 = (int*)malloc(num * sizeof(int));
	if (p1)
		for (int i = 0; i < num; i++)
			printf("%d ", *(p1 + i));
	free(p1);
	printf("\n");
	int* p2 = (int*)calloc(num , sizeof(int));
	if(p2)
		for (int i = 0; i < num; i++)
			printf("%d ", *(p2 + i));
	free(p2);
		return 0;
}